package Kasir;

import java.awt.*;
import java.util.*;
import javax.swing.JPanel;

public class KataJalan extends JPanel {

    private int x;

    public KataJalan() {
        x = 0;
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (x > this.getWidth()) {
            x = -300;
        }
        g.setColor(Color.getHSBColor((float) Math.random(), (float) Math.random(), (float) Math.random()));
        g.setFont(new Font("Arial", Font.BOLD, 30));
        g.drawString("SELAMAT DATANG", x += 5, getHeight() / 2);
    }
}
